package com.t373.entity;

import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author Jane
 * @date 2024-12-11 9:28
 */

public class Pet {

    private String pname;
    private int age;
    private PetType petType;  //宠物类型

    public Pet(){}

    public Pet(String pname, int age) {
        this.pname = pname;
        this.age = age;
    }
    public Pet(String pname, int age,PetType petType) {
        this.pname = pname;
        this.age = age;
        this.petType=petType;
    }

    public void show(){
        System.out.println(String.format("大家好,我是%s,我今年%s岁了,宠物类型%s"
                ,pname,age,petType==null?"":petType.getTypeName()));
    }

    public String getPname() {
        return pname;
    }

    public void setPname(String pname) {
        this.pname = pname;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public PetType getPetType() {
		return petType;
	}
    public void setPetType(PetType petType) {
		this.petType = petType;
	}
}
